import { NgModule,SkipSelf,Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule }   from '@angular/router';

import { SidebarUserComponent } from './sidebar-user/sidebar-user.component';
import { SidebarSystemComponent } from './sidebar-system/sidebar-system.component';
import { IndentButtonComponent } from './indent-button/indent-button.component';
import {MatButtonModule} from '@angular/material';
import { SidebarReportComponent } from './sidebar-report/sidebar-report.component';
import { SidebarTaskComponent } from './sidebar-task/sidebar-task.component';
import { SidebarThemeComponent } from './sidebar-theme/sidebar-theme.component';

// import { Service} from '../server/server';
@NgModule({
  imports: [
    CommonModule,
    RouterModule,
    MatButtonModule,
		RouterModule,
  ],
  declarations: [
    SidebarUserComponent,
    SidebarSystemComponent,
    IndentButtonComponent,
    SidebarReportComponent,
    SidebarTaskComponent,
    SidebarThemeComponent
  ],
  exports:[
    SidebarUserComponent,
    SidebarSystemComponent,
    IndentButtonComponent,
    SidebarReportComponent,
    SidebarTaskComponent,
    SidebarThemeComponent
  ]
})
export class SidebarModule {
  constructor(@Optional() @SkipSelf() parent :SidebarModule){
    if(parent){
      throw new Error('导航模块已经加载，不要再次加载')
    }
  }
  
}
